package com.neuedu.controller.registration;

import com.neuedu.bean.RestBean;
import com.neuedu.service.registration.RegisterServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@CrossOrigin
public class RegisterController {
    @Autowired
    private RegisterServcie registerServcie;
    //接诊
    @RequestMapping("/treatPatient")
    public RestBean treatPatient(Integer id){
        return registerServcie.treatPatient(id);
    }
    //退号
    @RequestMapping("/refundMedicalRecord")
    public RestBean refundMedicalRecord(Integer id){
        return registerServcie.refundMedicalRecord(id);
    }
    //得到患者信息(所有已经挂号状态为1的患者信息、分页)
    @RequestMapping("/getRecordRefundPatient")
    public RestBean getRecordRefundPatient(String case_number,String real_name,Integer nowPageNumber,Integer pageSize){
        return registerServcie.getRecordRefundPatient(case_number,real_name,nowPageNumber,pageSize);
    }
    //挂号
    @RequestMapping("/addRegister")
    public String addRegister(@RequestParam Map<String,Object> map){
        return registerServcie.addRegister(map);
    }
    //统计已挂号数量
    @RequestMapping("/getAlreadyRegisterCount")
    public String getAlreadyRegisterCount(String visitDate,String noon,String employeeId){
        return registerServcie.getAlreadyRegisterCount(visitDate,noon,employeeId);
    }
    //得到最大病历号
    @RequestMapping("/getMaxCaseNumber")
    public String getMaxCaseNumber(){
        return registerServcie.getMaxCaseNumber();
    }
}
